<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script src="js/numbers.js"></script>
<title>Cadastro de Paciente</title>
</head>
<body>
	<c:import url="cabecalho.jsp"/>
	<div id="fomulario_cadastro">
		<form  action="criancas" method="post">
			<c:if test="${crianca == null}">
				<div id="inserir">
					<fieldset>
						<legend>Cadastro de Paciente (Criança)</legend>					
						<label>Nome:<input type="text" name="nome"/></label>
						<label>Idade:<input type="text" name="idade" onkeypress="return isNumber(event)" maxlength="2"/></label>
						<label>Nome do Pai:<input type="text" name="nomePai" /></label>
						<label>Nome da Mãe:<input type="text" name="nomeMae"/></label>
						<label>Telefone: <input type="text" name="telefone"/></label>
						<input type="submit" name="action" value="Salvar"/>
						<input type="reset" value="Limpar"/>
					</fieldset>
				</div>
			</c:if>
			<c:if test="${crianca != null}">
				<div id="alterar">
					<fieldset>
						<legend>Cadastro de Paciente (Criança)</legend>					
						<input type="hidden" name="codigo" value="${crianca.codigo}"/>
						<label>Nome:<input type="text" name="nome" value="${crianca.nome}"/></label>
						<label>Idade:<input type="text" name="idade" value="${crianca.idade}" onkeypress="return isNumber(event)" maxlength="2"/></label>
						<label>Nome do Pai:<input type="text" name="nomePai" value="${crianca.nomePai}"/></label>
						<label>Nome da Mãe:<input type="text" name="nomeMae" value="${crianca.nomeMae}"/></label>
						<label>Telefone: <input type="text" name="telefone" value="${crianca.telefone}"/></label>
						<input type="submit" name="action" value="Salvar"/>
						<input type="reset" value="Limpar"/>
					</fieldset>
				</div>
			</c:if>
		</form>		
	</div>
</body>
</html>